include(ProcessorCount)
ProcessorCount(N)
if(N EQUAL 0)
  set(PARALLEL_LEVEL "")
else()
  set(PARALLEL_LEVEL "-j${N}")
endif()

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE "Release")
endif()

if(Qt5_VERSION)
  set(QT_VERSION ${Qt5_VERSION})
else()
  set(QT_VERSION ${Qt6_VERSION})
endif()

message(STATUS " ")
message(STATUS "Versions:")
message(STATUS "  Qaterial       : ${QATERIAL_VERSION}")
message(STATUS "  QOlm           : ${QOLM_VERSION}")
message(STATUS "  Qt             : ${QT_VERSION}")

message(STATUS " ")
message(STATUS "Targets:")
message(STATUS "  QaterialComponents : cmake --build . --target ${QATERIAL_TARGET}Components --config ${CMAKE_BUILD_TYPE} ${PARALLEL_LEVEL}")
message(STATUS "  QaterialIcons      : cmake --build . --target ${QATERIAL_TARGET}Icons --config ${CMAKE_BUILD_TYPE} ${PARALLEL_LEVEL}")
message(STATUS "  QaterialFonts      : cmake --build . --target ${QATERIAL_TARGET}Fonts --config ${CMAKE_BUILD_TYPE} ${PARALLEL_LEVEL}")
message(STATUS "  Qaterial           : cmake --build . --target ${QATERIAL_TARGET} --config ${CMAKE_BUILD_TYPE} ${PARALLEL_LEVEL}")

if(TARGET QaterialTestLoader)
message(STATUS " ")
message(STATUS "Tests:")
message(STATUS "  QaterialTestLoader : cmake --build . --target ${QATERIAL_TARGET}TestLoader --config ${CMAKE_BUILD_TYPE} ${PARALLEL_LEVEL}")
message(STATUS "  Run Tests          : ctest -C ${CMAKE_BUILD_TYPE} . --verbose --progress")
endif()

if(${QATERIAL_ENABLE_INSTALL})
message(STATUS " ")
message(STATUS "Install to \"${CMAKE_INSTALL_PREFIX}\":")
message(STATUS "  Install            : cmake --install . [--prefix <install-dir>]")
endif()

message(STATUS " ")
